package top.sxlai.controller;

import top.sxlai.entity.DTO.OpFolderDTO;
import top.sxlai.entity.OpFolder;
import top.sxlai.service.IFolderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author : sxl
 * @date : 2024/4/11 12:01
 * @Version: 1.0
 */
@RestController
public class FolderController {
    @Autowired
    private IFolderService iFolderService;
    //创建文件夹
    @PostMapping("/createFolder")
    public ResponseEntity<Map<String,String>> createFolder(@RequestBody OpFolderDTO folderDTO) throws Exception {
        return iFolderService.createFolder(folderDTO);
    }
    //查询文件夹
    @PostMapping("/queryFolder")
    public ResponseEntity<List<OpFolder>> queryFolder(@RequestBody OpFolderDTO folderDTO) throws Exception {
        return iFolderService.queryFolder(folderDTO);

    }
}
